﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Coater.Enum
{
    public enum NozzleEnum
    {
        Off = 0,
        Nozzle1 = 1,
        Nozzle2 = 2,
        Nozzle3 = 3,
        Nozzle4 = 4,
        Nozzle5 = 5,
        Nozzle6 = 6,
    }

    public static class NozzleEnumExtension
    {
        public static string GetName(this NozzleEnum nozzle)
        {
            switch (nozzle)
            {
                case NozzleEnum.Off:
                    return "Off";
                case NozzleEnum.Nozzle1:
                    return "Nozzle 1";
                case NozzleEnum.Nozzle2:
                    return "Nozzle 2";
                case NozzleEnum.Nozzle3:
                    return "Nozzle 3";
                case NozzleEnum.Nozzle4:
                    return "Nozzle 4";
                case NozzleEnum.Nozzle5:
                    return "Nozzle 5";
                case NozzleEnum.Nozzle6:
                    return "Nozzle 6";
                default:
                    return "Unknown";
            }
        }

        public static NozzleEnum GetEnum(string name)
        {
            switch (name)
            {
                case "Off":
                    return NozzleEnum.Off;
                case "Nozzle 1":
                    return NozzleEnum.Nozzle1;
                case "Nozzle 2":
                    return NozzleEnum.Nozzle2;
                case "Nozzle 3":
                    return NozzleEnum.Nozzle3;
                case "Nozzle 4":
                    return NozzleEnum.Nozzle4;
                case "Nozzle 5":
                    return NozzleEnum.Nozzle5;
                case "Nozzle 6":
                    return NozzleEnum.Nozzle6;
                default:
                    return NozzleEnum.Off;
            }
        }
    }

}
